package cn.hughie.str;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

/**
 * @author yuh
 * @date 2018/5/22 13:26
 * @description 在霍夫曼树 出现次数就是节点的权重 要离根节点最近
 */
public class ToB {

    public static void toBS(String s) throws IOException {
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(s.getBytes());
        DataInputStream dataInputStream = new DataInputStream(byteArrayInputStream);
        while (dataInputStream.available() > 0) {
            int read = dataInputStream.read();
            System.out.print(Integer.toBinaryString(read)+" ");
        }
    }

    public static void main(String[] args) throws IOException {
        toBS(",V;\b\u0000\u0000\u0000");
    }
}
